/**
 *  1.通过时间匹配(比如我们现在设置只有在 2019 年 1 月 1 日才会转发到我的网站，在这之前不进行转发)
 *      在某个时间之后能访问
 *      spring:
 *          cloud:
 *            gateway:
 *              routes:
 *               - id: time_route
 *                uri: http://ityouknow.com
 *                predicates:
 *                 - After=2018-01-20T06:06:06+08:00[Asia/Shanghai]
 *
 *       在某个时间之前能访问
 *       spring:
 *          cloud:
 *            gateway:
 *              routes:
 *               - id: after_route
 *                uri: http://ityouknow.com
 *                predicates:
 *                 - Before=2018-01-20T06:06:06+08:00[Asia/Shanghai]
 *
 *       在某个时间段之内能访问
 *       spring:
 *          cloud:
 *            gateway:
 *              routes:
 *               - id: after_route
 *                uri: http://ityouknow.com
 *                predicates:
 *                 - Between=2018-01-20T06:06:06+08:00[Asia/Shanghai], 2019-01-20T06:06:06+08:00[Asia/Shanghai]
 *
 *  2.通过 Cookie 匹配
 *        spring:
 *          cloud:
 *            gateway:
 *              routes:
 *               - id: cookie_route
 *                 uri: http://ityouknow.com
 *                 predicates:
 *                 - Cookie=ityouknow, kee.e
 *        能正常访问
 *        curl http://localhost:8080 --cookie "ityouknow=kee.e"
 *
 *        spring:
 *           cloud:
 *             gateway:
 *               routes:
 *               - id: header_route
 *                 uri: http://ityouknow.com
 *                 predicates:
 *                 - Header=X-Request-Id, \d+
 *        能正常访问
 *        curl http://localhost:8080  -H "X-Request-Id:666666"
 *
 *  3.通过 Host 匹配
 *          spring:
 *             cloud:
 *               gateway:
 *                 routes:
 *                 - id: host_route
 *                   uri: http://ityouknow.com
 *                   predicates:
 *                   - Host=**.ityouknow.com
 *           能正常访问
 *           curl http://localhost:8080  -H "Host: www.ityouknow.com"
 *           curl http://localhost:8080  -H "Host: md.ityouknow.com"
 *
 *  4.通过请求方式匹配
 *          spring:
 *              cloud:
 *                gateway:
 *                  routes:
 *                  - id: method_route
 *                    uri: http://ityouknow.com
 *                    predicates:
 *                    - Method=GET
 *          能正常访问
 *          curl http://localhost:8080
 *
 *  5.通过请求路径匹配
 *          spring:
 *              cloud:
 *                gateway:
 *                  routes:
 *                  - id: host_route
 *                    uri: http://ityouknow.com
 *                    predicates:
 *                    - Path=/foo/{segment}
 *            能正常访问
 *            curl http://localhost:8080/foo/1
 *            curl http://localhost:8080/foo/xx
 *            curl http://localhost:8080/boo/xx
 *
 *  6.通过请求参数匹配
 *            spring:
 *              cloud:
 *                gateway:
 *                  routes:
 *                  - id: query_route
 *                    uri: http://ityouknow.com
 *                    predicates:
 *                    - Query=smile
 *            能正常访问
 *            curl localhost:8080?smile=x&id=2
 *
 *            spring:
 *              cloud:
 *                gateway:
 *                  routes:
 *                  - id: query_route
 *                    uri: http://ityouknow.com
 *                    predicates:
 *                    - Query=keep, pu.
 *              能正常访问
 *              curl localhost:8080?keep=pub
 *
 *  7.通过请求 ip 地址进行匹配
 *             spring:
 *                cloud:
 *                  gateway:
 *                    routes:
 *                    - id: remoteaddr_route
 *                      uri: http://ityouknow.com
 *                      predicates:
 *                      - RemoteAddr=192.168.1.1/24
 *
 *  8.组合使用
 *              spring:
 *                  cloud:
 *                    gateway:
 *                      routes:
 *                       - id: host_foo_path_headers_to_httpbin
 *                        uri: http://ityouknow.com
 *                        predicates:
 *                        - Host=**.foo.org
 *                        - Path=/headers
 *                        - Method=GET
 *                        - Header=X-Request-Id, \d+
 *                        - Query=foo, ba.
 *                        - Query=baz
 *                        - Cookie=chocolate, ch.p
 *                        - After=2018-01-20T06:06:06+08:00[Asia/Shanghai]
 *           各种 Predicates 同时存在于同一个路由时，请求必须同时满足所有的条件才被这个路由匹配。
 */